package vechiles;

class Nonmoter{
    public String color;
    public  String brand;
    public  Nonmoter(String color,String brand){
        this.color=color;
        this.brand=brand;
    }
    public  void  say(){
        System.out.println("该非机动车的颜色是"+color+"，品牌是"+brand);
    }
}

class  Bicycle extends Nonmoter{
    private int seat;
    public  Bicycle(String color,String brand,int seat){
        super(color,brand);
        this.seat=seat;
    }
    public  void  say(){
        System.out.println("该自行车的颜色是"+color+"，品牌是"+brand+"，座位有"+seat+"个");
    }
}

class Electrocar extends  Nonmoter{
    private double power;
    public  Electrocar(String color,String brand,double power){
        super(color,brand);
        this.power=power;
    }
    public  void say(){
        System.out.println("该电动车的颜色是"+color+"，品牌是"+brand+"，电量为"+power);
    }
}

class Tricycle extends  Nonmoter{
    private int wheel;
    public  Tricycle(String color,String brand,int wheel){
        super(color,brand);
        this.wheel=wheel;
    }
    public  void say(){
        System.out.println( "该三轮车的颜色是"+color+"，品牌是"+brand+",轮子有"+wheel+"个");
    }
}

public class Non_moter {
    public  static void main(String[] args){
        Nonmoter a=new Nonmoter("red","1");
        a.say();
        Bicycle b=new Bicycle("white","2",2);
        b.say();
        Electrocar c=new Electrocar("black","2",42.4);
        c.say();
        Tricycle d=new Tricycle("green","3",3);
        d.say();
    }
}
